--[[
    开发者仓库调用
]]

local require = require
local uu     = require("modules.commhm.utils")
local config = require("modules.business_common.business_config")
local http   = require("modules.business_common.utils.business_http")

local ngx = ngx
local curr = os.time

local table = table
local pairs = pairs
local ipairs = ipairs
local tonumber = tonumber
local tostring = tostring
local loadstring = table.loadstring

local FOO = {
    _VERSION = '0.0.1'
}

local http_request = function( uin, request )
    request.Uin = uin
    local server = config.get_developers_server_url()
    local response = uu.json2table(http.Get(server, request) or "")
    if response and tonumber(response.code) == 0 then
        return true, response.data or {}
    end

    -- 失败日志
    http.Log(uu.to_str({ server = server, request = request, response = response }))
    return false, response and response.code
end


FOO.del_item_from_developers_bag = function (uin, params)
    uin = uin or ngx.ctx.m_params.uin
    return http_request(uin, params)
end


return FOO

